package com.cloud.controller;

import com.cloud.domain.LoginUser;
import com.cloud.pojo.UserApplyTest;
import com.cloud.service.ApplyTestService;
import com.cloud.tools.CommonResult;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： linJianHong
 * @dateTime： 21:21 2022/4/17
 * @Description: User apply for test control layer
 * @ClassName: ApplyTestController
 */

@RequestMapping("/apply/test")
@RestController
public class ApplyTestController {

    @Resource
    ApplyTestService applyTestService;

    /* 用户申请核酸检测 */
    @GetMapping(value = "/create")
    @PreAuthorize("hasAnyAuthority('apply:test:create')")
    public CommonResult applyTestCreate(){
        return applyTestService.create();
    }

    /* 用户查看核酸检测申请 */
    @GetMapping(value = "/retrieve")
    @PreAuthorize("hasAnyAuthority('apply:test:read')")
    public CommonResult applyTestRetrieve(){
        return applyTestService.retrieve();
    }
}
